﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace Celeriq.Graphing.Core
{
	public class SystemCoreInteractDomain
	{
		public static ChannelFactory<Celeriq.Graphing.Core.ISystemCore> GetFactory(string serverName)
		{
			var myBinding = new NetTcpBinding() { MaxBufferSize = 10 * 1024 * 1024, MaxReceivedMessageSize = 10 * 1024 * 1024, MaxBufferPoolSize = 10 * 1024 * 1024 };
			myBinding.ReaderQuotas.MaxStringContentLength = 10 * 1024 * 1024;
			myBinding.ReaderQuotas.MaxBytesPerRead = 10 * 1024 * 1024;
			myBinding.ReaderQuotas.MaxArrayLength = 10 * 1024 * 1024;
			myBinding.ReaderQuotas.MaxDepth = 10 * 1024 * 1024;
			myBinding.ReaderQuotas.MaxNameTableCharCount = 10 * 1024 * 1024;
			myBinding.Security.Mode = SecurityMode.Transport;
			var myEndpoint = new EndpointAddress("net.tcp://" + serverName + ":1973/__celeriq_core");
			return new ChannelFactory<Celeriq.Graphing.Core.ISystemCore>(myBinding, myEndpoint);
		}

	}
}
